package Q1;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        long num = scanner.nextLong();

        int count = 0;
        while (true) {
            //左边
            long left = num - count;
            long left1 = (long) Math.sqrt(left);
            if (Math.pow(left1, 2) == left) {
                System.out.println(left);
                return;
            }
            //右边
            long right = num + count;
            long right1 = (long) Math.sqrt(right);
            if (Math.pow(right1, 2) == right) {
                System.out.println(right);
                return;
            }

            count++;
        }
    }
}
